package com.biyu.monitormanage.controller;

import com.biyu.monitormanage.common.utils.BaseResponse;
import com.biyu.monitormanage.common.utils.PageUtils;
import com.biyu.monitormanage.service.MailLogService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @author 15491
 */
@Controller
@RequestMapping("/monitormanage/mail/log")
public class MailLogController {

    private final MailLogService logService;

    @Autowired
    public MailLogController(MailLogService logService) {
        this.logService = logService;
    }

    /**
     * 列表
     */
    @ResponseBody
    @GetMapping("/list")
    @RequiresPermissions("mail:log:list")
    public BaseResponse list(@RequestParam Map<String, Object> params){
        PageUtils page = logService.queryPage(params);

        return BaseResponse.ok().put("page", page);
    }
}
